from django.test import TestCase
from dynamicloselist.models import LearnLog,LoseRate
from dynamicloselist.views import add_learn_log,get_lose_rate,create_lose_rate

# Create your tests here.


class DynamicLoseListTestCase(TestCase):
    def setUp(self):
        create_lose_rate(
            {
                'userId':15
            }
        )

    def test_add_learen_log(self):
        data = {
            'userId': 15,
            'cardId': 3,
            'learnCount': 1,
            'logInfo': 'know',
        }
        result = add_learn_log(data)
        self.assertEqual(result, 0)

    def test_get_lose_rate(self):
        data = {
            'userId': 15,
        }
        result = get_lose_rate(data)

    def test_create_lose_rate(self):
        data = {
            'userId': 16,
        }
        result = create_lose_rate(data)

